Skip to main content

Interface: BasePeerConnection

Hierarchy

Properties

answerOptions

answerOptions: undefined | RTCAnswerOptions


bandwidth

bandwidth: Bandwidth


close

close: () => void

Type declaration

▸ (): void

Returns

void


configs

configs: MediaConfig[]


connectionState

connectionState: RTCPeerConnectionState


createDataChannel

createDataChannel: (label: string, dataChannelDict?: RTCDataChannelInit) => RTCDataChannel

Type declaration

▸ (label, dataChannelDict?): RTCDataChannel

Parameters
NameType
labelstring
dataChannelDict?RTCDataChannelInit
Returns

RTCDataChannel


getConfiguration

getConfiguration: () => RTCConfiguration

Type declaration

▸ (): RTCConfiguration

Returns

RTCConfiguration


getDataChannelConfigs

getDataChannelConfigs: () => DataChannelConfig[]

Type declaration

▸ (): DataChannelConfig[]

Returns

DataChannelConfig[]


getTransceiverConfigs

getTransceiverConfigs: () => TransceiverConfig[]

Type declaration

▸ (): TransceiverConfig[]

Returns

TransceiverConfig[]


hasICECandidates

hasICECandidates: boolean


iceConnectionState

iceConnectionState: RTCIceConnectionState


iceGatheringState

iceGatheringState: RTCIceGatheringState


offerOptions

offerOptions: undefined | RTCOfferOptions


peer

peer: ExtendedRTCPeerConnection


polite

polite: boolean


receivers

receivers: RTCRtpReceiver[]


references

references: References

Reference of any logical associations to the peer connection for logging


restartIce

restartIce: () => void

Type declaration

▸ (): void

Returns

void


senders

senders: RTCRtpSender[]


setConfiguration

setConfiguration: undefined | (configuration?: RTCConfiguration) => void

Only recently supported on some browser: https://caniuse.com/?search=setconfiguration


signalingState

signalingState: RTCSignalingState

Methods

addConfig

addConfig(peer, initOrConfig): DataChannelConfig

Parameters

NameType
peerRTCPeerConnection
initOrConfigDataChannelConfig | DataChannelInit

Returns

DataChannelConfig

addConfig(peer, initOrConfig): TransceiverConfig

Parameters

NameType
peerRTCPeerConnection
initOrConfigTransceiverConfig | TransceiverInit

Returns

TransceiverConfig

addConfig(peer, initOrConfig): TransceiverConfig | DataChannelConfig

Parameters

NameType
peerRTCPeerConnection
initOrConfigTransceiverConfig | DataChannelConfig | DataChannelInit | TransceiverInit

Returns

TransceiverConfig | DataChannelConfig


getStats

getStats(selector?): Promise<RTCStatsReport>

Parameters

NameType
selector?null | MediaStreamTrack

Returns

Promise<RTCStatsReport>


setLocalStream

setLocalStream(stream, target, shouldSyncMedia?): Promise<void>

Parameters

NameType
streamundefined | MediaStream
targetTransceiverConfigDirectionTuple[]
shouldSyncMedia?boolean

Returns

Promise<void>


setReference

setReference(key, value): void

Key/Value pair for referencing logical associations for logging

Parameters

NameTypeDescription
keystringThe key for the reference
valuestringThe value for the reference

Returns

void